package com.miracle.mango.util;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * @description:
 * @author: wangxf
 * @date: Created in 2020/8/23 15:25
 */
@Setter
@Getter
@NoArgsConstructor
@Accessors(chain = true)
public class ResultBody<T> implements Serializable {

    private static final long serialVersionUID = 1L;

    private String code;
    private String message;
    private T result;
    private String jwtToken;

    public ResultBody(T result) {
        this.code = "200";
        this.result = result;
    }

    public ResultBody(String message) {
        this.code = "200";
        this.message = message;
    }

    public ResultBody(String message, T result) {
        this.code = "200";
        this.message = message;
        this.result = result;
    }

    public ResultBody(String code, String message) {
        this.code = code;
        this.message = message;
    }

}
